<?php use_stylesheet('add_to_playlist.css')?>
<div id="add_to_playlist">
  <?php include_component('playlist', 'FormAddToPlaylist')?>
</div>
<?php javascript_tag()?>
/**
 * Carica la playolist da backend : playlist.php
 * Torna un elenco di videoid (formato json)
 */
function addToPlaylist(videoId, booleanValue ) 
{
	$(function() {
	  $('#add_to_playlist').children('img').attr('src', $('img#youtube-preview-'+videoId).attr('src'));
	  $('#add_to_playlist').dialog({
	    title:  '<?php echo __('Add to playlist')?>',
	    width:  400,
	    height: 200,
	    resizable:  false,
	    close: function (event,ui){ $('#add_to_playlist').load('<?php echo url_for('@add_to_playlist');?>')},
	  });
	});
  return false;
}

$(function() {
  $("input:submit").button();
});
<?php end_javascript_tag()?>